package com.foreveross.proxyip.web.action.report;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;

import com.foreveross.proxyip.application.pool.vo.ApplyIpLogReportVo;
import com.foreveross.proxyip.application.report.ApplyIpLogReportApplication;
import com.foreveross.proxyip.web.action.BaseAction;

@SuppressWarnings("serial")
@Namespace("/report/applyip")
@ParentPackage("json-default")
public class ApplyIpLogReportAction extends BaseAction {

	@Autowired
	ApplyIpLogReportApplication application ;
	
	ApplyIpLogReportVo vo = new ApplyIpLogReportVo();
	Integer pageIndex ,pageLen;
	
	@Action(value="toApplyipLogReport",results={@Result(name="dispatcher", type="dispatcher",location="/report/applyip_log_report.jsp")})
	public String toJsp() throws Exception {
		
		return "dispatcher";
	}
	
	/**
	 * 检索（按某些条件）
	 * @return
	 */
	@Action(value="search", results={@Result(name="JSON", type="json", params={"root","vo.pageData"})})
	public String search()throws Exception{
		try{
			application.searchByConditions(vo, pageIndex, pageLen);
		}catch(Exception e){
			e.printStackTrace();
		}

		return "JSON";
	}

	public ApplyIpLogReportVo getVo() {
		return vo;
	}

	public void setVo(ApplyIpLogReportVo vo) {
		this.vo = vo;
	}

	public Integer getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}

	public Integer getPageLen() {
		return pageLen;
	}

	public void setPageLen(Integer pageLen) {
		this.pageLen = pageLen;
	}
}
